<template>
	<view class="list-view">
		<view class="top-bar"><uni-navbar :fixed="true" :back="true" color="#fff" title="文件资料"></uni-navbar></view>

		<view class="info-box" v-if="id">
			<view class="info-title">
				{{ name }}
				<text class="dept">{{ dept }}</text>
			</view>
		</view>

		<view class="file-list" v-if="fileList.length > 0">
			<view>附件:</view>
			<view class="file-item" v-for="(item, index) in fileList" :key="index" @click="$showLine(item)">
				<view class="file-name clamp">{{ item.name }}</view>
				<view class="right-type">预览</view>
			</view>
		</view>
	</view>
</template>

<script>
export default {
	data() {
		return {
			id: '',
			dept: '',
			name: '',
			fileList: []
		};
	},
	onLoad(option) {
		this.id = option.id;
		this.name = decodeURI(option.name);
		this.dept = decodeURI(option.dept);
		this.loadData();
	},
	methods: {
		loadData() {
			this.$request('/huiyihuodong/hyhd-meeting/query?id=' + this.id).then((res) => {
				this.fileList = res.data.fileList;
			});
		}
	}
};
</script>

<style lang="scss">
.info-box {
	padding: 30rpx 30rpx;

	.info-title {
		margin-bottom: 14rpx;
	}
}
</style>
